//一、将下面异步代码使用Promise的方式改进

// setTimeout(function(){
//   var a = 'hello'
//   setTimeout(function(){
//       var b = 'lagou'
//       setTimeout(function(){
//         var c = 'I love U'
//         console.log(a+b+c)
//       },100)
// 	},100)
// },100)

//答案：
function timeoutFunc(value){
  return new Promise((resolve, reject)=>{
    setTimeout(function(){
      resolve(value)
    },100)
  })
}

let promise = timeoutFunc('hello');
promise.then(value => {
    let a = 'lagou'
    return timeoutFunc(value + a)
}).then(value => {
  let a = 'I love U'
  console.log(value+a)
})



